<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/5/31 0031
 * Time: 下午 5:09
 */
header("Content-type:text/html;charset=utf-8");
header("Access-Control-Allow-Origin:*");

$connection = new mysqli("127.0.0.1","root","","mytps138");

mysqli_query($connection,"set names utf8");

$sql = 'SELECT*FROM goods WHERE gostatus=1';

$res = $connection->query($sql);
//print_r($res);
$arrlist = array();

if($res->num_rows>=1){
    while ($row = $res->fetch_assoc()){
        array_push($arrlist,$row);
    }
}
print_r(json_encode($arrlist));


